public class Test {
    public static int fun(int n){
        if(n == 1){
            return 1;
        }
        return 2*fun(n-1)+1;
    }
    public static void main(String[] args) {
        System.out.println(fun(1));
        System.out.println(fun(2));//3
        System.out.println(fun(3));//7
        System.out.println(fun(4));//15
    }
}
